<?php
class Messages {
	
	var $messages;
	
	function add($message) {
		$this->messages[count($this->messages)] = $message;
	}
	
	function add2($text, $type){
		$this->add(new Message($text, $type));
	}
	
	function show() {
		for($i = 0; $i < count($this->messages); $i++) {
	    	$this->messages[$i]->show();
	  	}
	}
}
?>